package cn.zx.service;


import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @author zhaoxiang
 * @version 1.0
 * @Date 2019/9/4 11:17
 */
@Service
public class TaskServiceImpl implements TaskService {

//    @Scheduled(initialDelay = 1000,fixedDelay = 1000)
    @Scheduled(cron = "*/5 * * * * ?")
    @Override
    public void firstTask() {
        System.out.println("这是第一个定时任务firstTask："+new Date());
    }

//    @Scheduled(initialDelay = 2000,fixedDelay = 4000)
    @Scheduled(cron = "0 26 * * * ?")
    @Override
    public void secondTask() {
        System.out.println("这是第二个定时任务secondTask："+new Date());
    }
}
